package com.zw.pm.base;

import com.alibaba.excel.annotation.ExcelIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

/**
 * @Description: 数据表基类
 *
 * @author: China.sgl
 * @Date: 2019/8/7 09:51
 */
@Data
public class BaseModel implements Serializable {

    /** 开始时间 */
    @ExcelIgnore
    private Date startTime;

    /** 结束时间 */
    @ExcelIgnore
    private Date endTime;

    public void setEndTime(Date endTime) {
        if (endTime != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endTime);
            cal.add(Calendar.DAY_OF_YEAR, 1);
            this.endTime = cal.getTime();
        } else {
            this.endTime = endTime;
        }
    }
}
